<?php
/**
 * Permet de definir une fenetre a l'ecran
 * @author Micou13630
 *
 */
class Window extends Layout implements IRenderable {
	
	protected $title;
	protected $showTitle;
		
	protected $animateMinimize;
	protected $defaultMinimizeHeight;
	protected $minimizeHeight;
	protected $minimizeTime;
	
	protected $autoCenter;
	protected $autoSize;
	protected $maximized;
	protected $minimized;
	
	protected $bodyColor;
	protected $bodyConstructor;
	protected $bodyDefaults;
	protected $bodyStyle;
	
	protected $canDragReposition;
	protected $canDragResize;
	protected $canFocusInHeaderButtons;
	protected $dismissOnEscape;
	protected $dismissOnOutsideClick;
	
	protected $contentLayout;
	
	protected $contentsType;
	
	protected $footerControls;
	protected $footerHeight;
	
	protected $headerControls;
	protected $headerIcon;
	protected $headerIconDefaults;
	protected $headerLabel;
	protected $headerLabelDefaults;
	protected $headerSrc;
	protected $headerStyle;
	
	protected $showBody;
	protected $showCloseButton;
	protected $showFooter;
	protected $showHeader;
	protected $showHeaderBackground;
	protected $showHeaderIcon;
	protected $showMaximizeButton;
	protected $showMinimizeButton;
	protected $showResizer;
			
	protected $isModal;
	protected $modalMaskOpacity;
	protected $modalMaskStyle;
	protected $showModalMask;
	
	protected $showStatusBar;
	protected $status;
	
	protected $items;
	protected $src;
	
	/**
	 * Constructeur
	 */
	public function Window($title = null) {
		parent::Layout();

		$this->items = array();
		$this->title = $title;
	}
	
	/**
	 * Enter description here ...
	 * @param IRenderable $member
	 */
	public function addItem(IRenderable $item) {
		$this->items[] = $item;
	}

	/**
	 * Implementation de object
	 * @see IRenderable::object()
	 */
	public function object() {
		return get_class($this);
	}

	/**
	 * Implementation de properties
	 * @see IRenderable::properties()
	 */
	public function properties() {
		return parent::getProp($this);
	}
	
	/**
	 * Implementation de scLog
	 * @see IRenderable::scLog()
	 */
	public function scLog() {
		ScCollectionLog::getInstance()->addSc(new ScLog($this->object(), get_object_vars($this)));
	}

	/**
	 * Implementation de render
	 * @see IScreen::render()
	 */
	public function render() {
		$this->scLog();
		return "isc.".$this->object().".create({".$this->properties()."});";
	}
	
}

?>